(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/order-hall/order-hall" ], {
    "44fb": function(e, n, o) {
        (function(r) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var s = e(o("4795")), a = e(o("5438"));
            function e(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            function l(e, t, n, o, c, a, r) {
                try {
                    var s = e[a](r), l = s.value;
                } catch (e) {
                    return n(e), 0;
                }
                s.done ? t(l) : Promise.resolve(l).then(o, c);
            }
            function u(s) {
                return function() {
                    var e = this, r = arguments;
                    return new Promise(function(t, n) {
                        var o = s.apply(e, r);
                        function c(e) {
                            l(o, t, n, c, a, "next", e);
                        }
                        function a(e) {
                            l(o, t, n, c, a, "throw", e);
                        }
                        c(void 0);
                    });
                };
            }
            var t = {
                data: function() {
                    return {
                        lng: "",
                        lat: "",
                        collectorid: "",
                        orders: [],
                        tempId: ""
                    };
                },
                onShow: function() {
                    this.systems(), a.default.releaseKey("submit");
                },
                onLoad: function(e) {
                    console.log("options", e), this.lng = e.lng, this.lat = e.lat, this.collectorid = e.collectorid;
                },
                methods: {
                    previewImage: function(e, t) {
                        console.log("预览图片", e, t), wx.previewImage({
                            current: t,
                            urls: e
                        });
                    },
                    upCallback: function(n) {
                        var o = this;
                        return u(s.default.mark(function e() {
                            var t;
                            return s.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, o.$http({
                                        url: o.$api.collectorRobCenter,
                                        data: {
                                            collectorid: o.collectorid,
                                            latitude: o.lat,
                                            longitude: o.lng,
                                            page: n.num,
                                            psize: 5
                                        }
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (console.log("抢单大厅", t.data), o.mescroll.endByPage(t.data.list.length, t.totalPage), 
                                    1 == n.num && (o.orders = []), o.orders = o.orders.concat(t.data.list));

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    },
                    selectAddress: function(e, t, n, o) {
                        o = n + o;
                        console.log("点击查看位置", e, t), r.openLocation({
                            latitude: Number(t),
                            longitude: Number(e),
                            address: o,
                            scale: 18,
                            success: function(e) {
                                console.log("success", e);
                            }
                        });
                    },
                    collectorReceive: function(o) {
                        var e, c = this;
                        a.default.uniDoFunc({
                            key: "submit",
                            success: (e = u(s.default.mark(function e() {
                                var t, n;
                                return s.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        return e.next = 2, c.$http({
                                            url: c.$api.collectorReceive,
                                            data: {
                                                collectorid: c.collectorid,
                                                orderid: o,
                                                uid: r.getStorageSync("uid")
                                            }
                                        });

                                      case 2:
                                        0 == (t = e.sent).errno ? (n = t.message, null == c.tempId || "" == c.tempId ? r.showModal({
                                            title: "提示",
                                            showCancel: !1,
                                            content: n,
                                            success: function(e) {
                                                if (e.confirm) a.default.releaseKey("submit"), r.navigateBack({
                                                    delta: 1
                                                }); else if (e.cancel) return;
                                            }
                                        }) : (a.default.releaseKey("submit"), c.acceptMessage(o, n)), console.log("立即接单", t)) : (a.default.releaseKey("submit"), 
                                        console.log("11111111111111111111"), c.$sun.toast(t.message)), console.log("防抖... 在事件触发前连续点击事件会重新计时");

                                      case 5:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function() {
                                return e.apply(this, arguments);
                            })
                        });
                    },
                    acceptMessage: function(o, c) {
                        var t, a = this;
                        console.log("订阅消息", o), wx.getSetting({
                            withSubscriptions: !0,
                            success: (t = u(s.default.mark(function e(t) {
                                var n;
                                return s.default.wrap(function(e) {
                                    for (;;) switch (e.prev = e.next) {
                                      case 0:
                                        if (console.log("=================", t, t.subscriptionsSetting), 0 == t.subscriptionsSetting.mainSwitch) return e.next = 4, 
                                        a.$http({
                                            url: a.$api.receiveSendSubMessage,
                                            data: {
                                                orderid: o
                                            }
                                        });
                                        e.next = 8;
                                        break;

                                      case 4:
                                        0 == (n = e.sent).errno && (console.log("订阅消息1111", n), r.showModal({
                                            title: "提示",
                                            showCancel: !1,
                                            content: c,
                                            success: function(e) {
                                                if (e.confirm) r.navigateBack({
                                                    delta: 1
                                                }); else if (e.cancel) return;
                                            }
                                        })), e.next = 9;
                                        break;

                                      case 8:
                                        r.requestSubscribeMessage({
                                            tmplIds: [ a.tempId ],
                                            success: function() {
                                                var t = u(s.default.mark(function e(t) {
                                                    var n;
                                                    return s.default.wrap(function(e) {
                                                        for (;;) switch (e.prev = e.next) {
                                                          case 0:
                                                            if (console.log("data", t, a.tempId, [ a.tempId ]), "accept" == t[a.tempId]) return console.log("授权成功", t), 
                                                            e.next = 5, a.$http({
                                                                url: a.$api.receiveSendSubMessage,
                                                                data: {
                                                                    orderid: o
                                                                }
                                                            });
                                                            e.next = 9;
                                                            break;

                                                          case 5:
                                                            0 == (n = e.sent).errno && (console.log("订阅消息1111", n), r.showModal({
                                                                title: "提示",
                                                                showCancel: !1,
                                                                content: c,
                                                                success: function(e) {
                                                                    if (e.confirm) r.navigateBack({
                                                                        delta: 1
                                                                    }); else if (e.cancel) return;
                                                                }
                                                            })), e.next = 10;
                                                            break;

                                                          case 9:
                                                            wx.showModal({
                                                                title: "温馨提示",
                                                                content: "您已拒绝授权，将无法在微信中收到通知！",
                                                                showCancel: !1,
                                                                success: function(e) {
                                                                    e.confirm && r.showModal({
                                                                        title: "提示",
                                                                        showCancel: !1,
                                                                        content: c,
                                                                        success: function(e) {
                                                                            if (e.confirm) r.navigateBack({
                                                                                delta: 1
                                                                            }); else if (e.cancel) return;
                                                                        }
                                                                    });
                                                                }
                                                            });

                                                          case 10:
                                                          case "end":
                                                            return e.stop();
                                                        }
                                                    }, e);
                                                }));
                                                return function(e) {
                                                    return t.apply(this, arguments);
                                                };
                                            }()
                                        });

                                      case 9:
                                      case "end":
                                        return e.stop();
                                    }
                                }, e);
                            })), function(e) {
                                return t.apply(this, arguments);
                            }),
                            fail: function(e) {
                                console.log("失败", e);
                            },
                            complete: function(e) {
                                console.log("完成", e);
                            }
                        });
                    },
                    systems: function() {
                        var n = this;
                        return u(s.default.mark(function e() {
                            var t;
                            return s.default.wrap(function(e) {
                                for (;;) switch (e.prev = e.next) {
                                  case 0:
                                    return e.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (t = e.sent).errno && (console.log("系统设置", t), n.tempId = t.data.userTemplate);

                                  case 4:
                                  case "end":
                                    return e.stop();
                                }
                            }, e);
                        }))();
                    }
                }
            };
            n.default = t;
        }).call(this, o("543d").default);
    },
    "65f2": function(e, t, n) {
        n.r(t);
        var o, c = n("f453"), a = n("c46b");
        for (o in a) "default" !== o && function(e) {
            n.d(t, e, function() {
                return a[e];
            });
        }(o);
        n("ad3a");
        var r = n("f0c5"), c = Object(r.a)(a.default, c.b, c.c, !1, null, null, null, !1, c.a, void 0);
        t.default = c.exports;
    },
    ad3a: function(e, t, n) {
        var o = n("bb05");
        n.n(o).a;
    },
    ae1e: function(e, t, n) {
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("8163"), t(n("66fd")), e(t(n("65f2")).default);
        }).call(this, n("543d").createPage);
    },
    bb05: function(e, t, n) {},
    c46b: function(e, t, n) {
        n.r(t);
        var o, c = n("44fb"), a = n.n(c);
        for (o in c) "default" !== o && function(e) {
            n.d(t, e, function() {
                return c[e];
            });
        }(o);
        t.default = a.a;
    },
    f453: function(e, t, n) {
        function o() {
            this.$createElement, this._self._c;
        }
        var c = [];
        n.d(t, "b", function() {
            return o;
        }), n.d(t, "c", function() {
            return c;
        }), n.d(t, "a", function() {});
    }
}, [ [ "ae1e", "common/runtime", "common/vendor" ] ] ]);